package com.ry.demo.concurrent.demo;

import java.util.Iterator;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @Author: lihui
 * @Date: 2021-12-29 09:09
 * @Description:
 */
public class LinkedBlockingQueueDemo {

    public static void main(String[] args) throws InterruptedException {

        LinkedBlockingQueue<String> linkedBlockingDeque = new LinkedBlockingQueue(3);
        linkedBlockingDeque.put("a");
        linkedBlockingDeque.put("b");

        //String take = linkedBlockingDeque.take();


        Iterator<String> iterator = linkedBlockingDeque.iterator();


        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }

    }

}
